<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script type="text/javascript" src="js/vue.min.js"></script>
<body>
<div id="app">
    <form action="">
        用户名：<input type="text" v-model="uname">
        密码：<input type="password" v-on:keyup.enter="HandleSubmit" v-model="pwd">
        <input type="button" v-on:click="HandleSubmit" value="提交">
        <input type="button" v-on:click="HandleDelet" value="删除">
    </form>
</div>
</body>
<script type="text/javascript">
    var vm = new Vue({
        el: "#app",
        data: {
            uname: "",
            pwd: ""
        },
        methods: {
            HandleSubmit: function () {
                console.log(this.uname, this.pwd)
            },
            HandleDelet: function () {
                this.uname = '',
                    this.pwd = ''
            }
        }
    })

</script>
</html>